#include <iostream>
#include <cmath>
using namespace std;

int main(){
	freopen("in.txt","r",stdin);
	double r1,p1,r2,p2;
	cin >> r1 >> p1 >> r2 >> p2;
	double r3 = r1*r2,p3 = p1 + p2;
    if( r3*sin(p3) < 0 )
	    printf("%.2f%.2fi",r3*cos(p3),r3*sin(p3));
    else if(r3*sin(p3) == 0) printf("%.2f",r3*cos(p3));
	else printf("%.2f+%.2fi",r3*cos(p3),r3*sin(p3));
	return 0;
}
